
(function () {
    document.querySelector('.songlist__songname').addEventListener('click', function (e) {
        e.preventDefault()
    })
    const juezhan = document.querySelector('.juezhan')
    const tiantai = document.querySelector('.tiantai')
    const haikuo = document.querySelector('.haikuo')
    const yumou = document.querySelector('.yumou')
    let flag = true
    document.querySelector('table').addEventListener('click', function (e) {
        if (e.target.className === 'bofang' && e.target.dataset.id === '0') {
            console.log(111);
            if (flag) {
                juezhan.play()
                e.target.style.backgroundPosition = '0 -200px'
                flag = false
            } else {
                juezhan.pause()
                e.target.style.backgroundPosition = '0 0px'
                flag = true
            }
        } else if (e.target.className === 'bofang' && e.target.dataset.id === '1') {
            console.log(111);
            if (flag) {

                tiantai.play()
                e.target.style.backgroundPosition = '0 -200px'
                document.querySelector('.mod_list_menu').style.opacity = '1'
                flag = false
            } else {
                tiantai.pause()
                e.target.style.backgroundPosition = '0 0px'
                flag = true
            }
        } else if (e.target.className === 'bofang' && e.target.dataset.id === '2') {
            console.log(111);
            if (flag) {
                haikuo.play()
                e.target.style.backgroundPosition = '0 -200px'
                document.querySelector('.mod_list_menu').style.opacity = '1'
                flag = false
            } else {
                haikuo.pause()
                e.target.style.backgroundPosition = '0 0px'
                flag = true
            }
        } else if (e.target.className === 'bofang' && e.target.dataset.id === '3') {
            console.log(111);
            if (flag) {
                yumou.play()
                e.target.style.backgroundPosition = '0 -200px'
                document.querySelector('.mod_list_menu').style.opacity = '1'
                flag = false
            } else {
                yumou.pause()
                e.target.style.backgroundPosition = '0 0px'
                flag = true
            }
        }

    })
})()